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

 

View solution in original post

this is exactly what I was looking for thanks @RezaDorrani 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

secondImage

Experience what’s next for Power Apps

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

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (99,238)