cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

@Anonymous 

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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3

@Anonymous 

 

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 @Anonymous 

Anonymous
Not applicable

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

@Anonymous 

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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,824)