cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KUNGFUPANDA559
Level: Powered On

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

Re: retrieve value from first record in table and store in variable

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

Re: retrieve value from first record in table and store in variable

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

KUNGFUPANDA559
Level: Powered On

Re: retrieve value from first record in table and store in variable

this is exactly what I was looking for thanks @RezaDorrani 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,221)