cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

Expressions of Flow

hi

 

Please kindly confirm how to correct my expression as below since error happened.

if(empty(triggerBody()?['Address']),Items('GetVendorInfor')?['Address'],triggerBody()?['Address'])
 
The template validation failed: 'The workflow action 'Initialize_variable' at line '1 and column '5366' references the action 'GetVendorInfor' of type 'ApiConnection': only the actions of type 'foreach' are allowed to be referenced by 'repeatItems' or 'items' functions.'.
 
キャプチャ.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User II
Dual Super User II

Hi @Tiffany-Jo 

 

 

if(empty(triggerBody()?['Address']),body('GetVendorInfor')?['value']?[0]?['Address'],triggerBody()?['Address']) 

 

This body('GetVendorInfor')?['value']?[0]?['Address'] will give you the first Address value from the GetVendorInfor action

 

Regards,

Reza Dorrani

 

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

2 REPLIES 2
Super User III
Super User III

Hi,

 

Believe your second step is Get Items (Sorry it's not in English) which can return one or more items. So the next step must be a for each loop. Also you need to declare the initialise variable before your Get Items step. Later use the intialise varaible inside the for each loop using the flow action setp Set variable.

 

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



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Dual Super User II
Dual Super User II

Hi @Tiffany-Jo 

 

 

if(empty(triggerBody()?['Address']),body('GetVendorInfor')?['value']?[0]?['Address'],triggerBody()?['Address']) 

 

This body('GetVendorInfor')?['value']?[0]?['Address'] will give you the first Address value from the GetVendorInfor action

 

Regards,

Reza Dorrani

 

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
New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (98,903)