Forum Discussion
M if text contains, if not empty
- 4 years ago
in was missing
let l=List.Transform( Text.Split([#"Tags (created on)"]," "), each Text.Remove(_,{"(",")",","})),
i=List.PositionOf(l, "BLUETEXT")
in if i>=0 then l{i+1} & " " & l{i+2} else null
I think should work for you in last line
if i>=0 then l{i+1} & " " & l{i+2} else null
- modwonka4 years ago
Helper I
Thanks for your answer Vijay_A_Verma!
I tried the solution with your code:
let l=List.Transform( Text.Split([#"Tags (created on)"]," "), each Text.Remove(_,{"(",")",","})),
i=List.PositionOf(l, "BLUETEXT"),
if i>=0 then l{i+1} & " " & l{i+2} else nullThere's one error: "Token identifier expected". In the "if". Is this ok?
- Vijay_A_Verma4 years ago
Most Valuable Professional
in was missing
let l=List.Transform( Text.Split([#"Tags (created on)"]," "), each Text.Remove(_,{"(",")",","})),
i=List.PositionOf(l, "BLUETEXT")
in if i>=0 then l{i+1} & " " & l{i+2} else null- modwonka4 years ago
Helper I
Thank you so much! That worked 😉