cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
prakash_Mathi
Helper III
Helper III

How to convert a Text Type to Record Type?

Hi All,

 

How to convert a Text type to record type in the below formula?

 

My data source is SharePoint.

Data Source List Name is: New Data Request_2

"IDTitle" is a column in SharePoint with 'Choice' Data type i.e., I am trying to give "IDTitle" column in dropdown in edit form.

Trying to Concatenate 'ID' and 'Title' column and store that in "IDTitle" column.

 

UpdateIf('New Data Request_2', ID=Form1.LastSubmit.ID, {IDTitle: Text(Form1.LastSubmit.ID) & "-" Form1.LastSubmit.Title})

 

Error which i am getting - Incompatible type, The 'IDTitle' column in the data source you are updating expects a 'Record' type and you are using a 'Text' type.

 

Please let me know how to change this formula as Record Type.

 

Thanks in Advance

Prakash

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@prakash_Mathi 

You mention that your column is a Choice column.  I would assume you are allowing write-in values to that column, otherwise assigning random values will not work properly.

 

If so, then your Formula should be the following:

UpdateIf('New Data Request_2', 
    ID=Form1.LastSubmit.ID, 
    {
        IDTitle: {Value:Text(Form1.LastSubmit.ID) & "-" Form1.LastSubmit.Title}
    }
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

3 REPLIES 3
poweractivate
Super User II
Super User II

@prakash_Mathi 

 

Record is made like this

 

Text:

 

"Some Text"

 

Record:

 

{SomeInnerColumnOrKey: "SomeStringValue"}

 

Record with two columns and values (there can be more than two, here is an example of two columns and values though):

{SomeInnerColumnOrKey: "SomeStringValue", SomeInnerColumnOrKey2: "SomeStringValue2"}

 

Depending on your case, "SomeStringValue" would not be valid if the schema is expecting another type of Value there.

 

For your case, it is related to it being a Choice field. Make sure to pass into it a Record inline instead of Text. So something like IDTitle: { SomeKey: "SomeValue"} instead of just "SomeValue"

 

We'll leave it up to you for now to figure out the correct SomeKey and "SomeValue" for your specific scenario.

 

Check if above helps @prakash_Mathi 

Hi @poweractivate ,

 

Thanks for the explanation. I was able to understand your explanation but unable to execute it. I tried but not sure with my code and ending up with errors.

Some sample code will be helpful or altering my above code will be helpful since i am new to power apps.

 

Thanks in Advance

Prakash 

RandyHayes
Super User III
Super User III

@prakash_Mathi 

You mention that your column is a Choice column.  I would assume you are allowing write-in values to that column, otherwise assigning random values will not work properly.

 

If so, then your Formula should be the following:

UpdateIf('New Data Request_2', 
    ID=Form1.LastSubmit.ID, 
    {
        IDTitle: {Value:Text(Form1.LastSubmit.ID) & "-" Form1.LastSubmit.Title}
    }
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (46,389)