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 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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,930)