I want to set string variable to empty. I am initializing string viriable empty then I am appending that variable in loop but before appending loop each time I want to make it empty.
Is there any way to do that
Solved! Go to Solution.
Hey @milind
You can use the expression editor to set the value as null and it will empty that variable:
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Hey @milind
You can use the expression editor to set the value as null and it will empty that variable:
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
thats wonderful solution 🙂
This approach suddenly stopped working for me about a week ago... has the syntax of the null functoin changed?
Hey @Matt_Markahm
I have made another test on my side and it is working as expected. Are you facing any errors or issues? Can you share a screenshot of that?
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
I am using a string variable to capture a set of values stored in a SharePoint multi-select list, put them together into a text field and then print that field to a MS Word template for a report.
I initialize the variable:
Initializing the String Variable
Then I use a loop to append values to the string:
Once the value of the string variable has been written to an instance of the report, I am trying to clear it using the method previously described:
This approach was working, but lately it has been failing as you can see in this example of the results from one of the generated Word files:
There should be no repeats in this list if the string variable is being set to null between each iteration of the loop... instead it seems that the list just grows and grows as each record's list is appended to the variable. Any suggestions would be greatly appreciated.
Thanks!
Matt
Hey @Matt_Markahm
Is null string a variable that you created?
If you observe the screenshot that I have shared, you will see that i just used null. You can do that by placing the cursor in the value and then in the expression editor, type null and choose from the filtered list.
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Has anyone found a new way to do this? Using null() in the expression builder for the Set Variable step is no longer allowed, it says invalid and won't let me save it. I need to find a way to actually clear it out.
I'm new to Power Automate under Windows 10 21H1 (free version). The only way I discovered to clear a string variable is to use the Clear List command. It seems to treat it as a list of characters and create a truly empty string that works with the 'is empty' IF statement.
Thank you for this! I added this Null/clear to my solution and it worked out perfectly.
Hi @Rick97213,
what is "Clear List" command? Could you please explain?
this works for me
Yes. It really works for me.
Thanks
User | Count |
---|---|
85 | |
37 | |
25 | |
13 | |
12 |
User | Count |
---|---|
116 | |
55 | |
36 | |
23 | |
21 |