cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JustinBieb
Frequent Visitor

How to create a single value array from a string

Hi there,

 

My question as in the subject.

  1. The Flow trigger is "When an event is modified (V1)".
  2. The Flow action is "Set variable".
  3. The variable I wish to set is the previously initiated array varArrCat, containing the copied values from the array Categories.
  4. I want to convert that array into one with a single value; the string DisplayName.
  5. I then want to use that array to set the Categories field in the action "Update event (V1)" (advanced settings).

 

I tried setting the value of varArrCat with the expression array(triggerBody()?['DisplayName']), but that results in an array with the single value null.

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @JustinBieb,

 

Could you please show a bit more about DisplayName?

The output of “When an event is modified” trigger doesn’t contain DisplayName property, so the calculation result of expression array(triggerBody()?[‘DisplayName’]) is null.

I find the DisplayName in Location property, please consider type the following formula in “Set variable” action:

 

array(triggerBody()?['Location']?['DisplayName'])

The flow works successfully as below:2.JPG

 

3.JPG

 

4.JPG

 

Besides, the flow you designed would fall in a “Update” loop, please consider switch trigger to “When an event is created (V1)”.

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xida-msft
Community Support
Community Support

Hi @JustinBieb,

 

Could you please show a bit more about DisplayName?

The output of “When an event is modified” trigger doesn’t contain DisplayName property, so the calculation result of expression array(triggerBody()?[‘DisplayName’]) is null.

I find the DisplayName in Location property, please consider type the following formula in “Set variable” action:

 

array(triggerBody()?['Location']?['DisplayName'])

The flow works successfully as below:2.JPG

 

3.JPG

 

4.JPG

 

Besides, the flow you designed would fall in a “Update” loop, please consider switch trigger to “When an event is created (V1)”.

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,420)