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

retrieve value from first record in table and store in variable

I seem to be having issues storing record value to variable.  

 

datasource.desired_field=123456789012345

 

varFinalValue should equal "123456789012345" not a table.  

 

Thoughts?

 

set(varFinalValue,Value(datasource.desired_field))

 

datasource: SQL

datatype: varchar(15)

1 ACCEPTED SOLUTION

Accepted Solutions
RezaDorrani
Dual Super User II
Dual Super User II

Hi @KUNGFUPANDA559 

 

set(varFinalValue,Value(datasource.desired_field))

will return a table because your are getting all records for data source with column desired_field

 

you can either get first value from collection

set(varFinalValue,Value(First(datasource).desired_field))

 

or lookup data based on condition

set(varFinalValue,Value(Lookup(datasource,condition).desired_field))

 

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

Hi @KUNGFUPANDA559 

 

set(varFinalValue,Value(datasource.desired_field))

will return a table because your are getting all records for data source with column desired_field

 

you can either get first value from collection

set(varFinalValue,Value(First(datasource).desired_field))

 

or lookup data based on condition

set(varFinalValue,Value(Lookup(datasource,condition).desired_field))

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

this is exactly what I was looking for thanks @RezaDorrani 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,937)