cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Dual Super User II
Dual Super User II

Re: Expressions of Flow

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
Highlighted
Super User III
Super User III

Re: Expressions of Flow

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
Highlighted
Dual Super User II
Dual Super User II

Re: Expressions of Flow

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,182)