cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tfmarcomtf
Frequent Visitor

Convert ComboBox Selected Values to Text to update fields in another table

Hi,

 

I have 2 tables in Excel. First one is a list of assets called AssetList. The second is a record/transaction table called TransactionOut. In the app, the user selects from a combobox as many items as they wish to checkout. On the next page, when the user checks out the items, the checkout button, using a collection method, updates the excel TransctionsOut table with the users name(selected previously), the checkout date and of course the list of items they selected from the combo box.

 

The issue I am having is that the combobox data comes from the AssetList table and the column I am trying to update in the TransactionsOut table expects a text type and not a table type. 

 

I cannot figure out how to properly convert my combobox selected values to a text type so the record can properly update.

 

This is the formula I am using:

 

Collect(TransactionOut, {CheckedOutTo: Scan1 & StaffName, AssetTag: ComboBox1.SelectedItems, DateTime: Text(Now())});Navigate(CheckoutConfirm2,ScreenTransition.None))

 

Please help.

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @tfmarcomtf,

Do you want to convert the selected Values within the ComboBox (in the first screen) into a Text value?

Do you want to add a new record into your TransctionsOut table?

Based on the needs that you mentioned, I think the Concat function could achieve your needs. I have made a test on my side, please consider modify your formula as below:

Collect(
TransactionOut,
{
CheckedOutTo: Scan1 & StaffName,
AssetTag: Concat(ComboBox1.SelectedItems, Value & "; "), /* <-- Modify formula here */
DateTime: Text(Now())
}
);
Navigate(CheckoutConfirm2,ScreenTransition.None)

In addition, you could also consider take a try with Patch function to achieve your needs, please take a try with the following formula:

Patch(
TransactionOut,
Defaults(TransactionOut),
{
CheckedOutTo: Scan1 & StaffName,
AssetTag: Concat(ComboBox1.SelectedItems, Value & "; "), /* <-- Modify formula here */
DateTime: Text(Now())
}
);
Navigate(CheckoutConfirm2,ScreenTransition.None)

More details about the Concat function, please check the following article:

Concat function

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

Hi @tfmarcomtf,

Have you solved your problem?

If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

4 REPLIES 4
v-xida-msft
Community Support
Community Support

Hi @tfmarcomtf,

Do you want to convert the selected Values within the ComboBox (in the first screen) into a Text value?

Do you want to add a new record into your TransctionsOut table?

Based on the needs that you mentioned, I think the Concat function could achieve your needs. I have made a test on my side, please consider modify your formula as below:

Collect(
TransactionOut,
{
CheckedOutTo: Scan1 & StaffName,
AssetTag: Concat(ComboBox1.SelectedItems, Value & "; "), /* <-- Modify formula here */
DateTime: Text(Now())
}
);
Navigate(CheckoutConfirm2,ScreenTransition.None)

In addition, you could also consider take a try with Patch function to achieve your needs, please take a try with the following formula:

Patch(
TransactionOut,
Defaults(TransactionOut),
{
CheckedOutTo: Scan1 & StaffName,
AssetTag: Concat(ComboBox1.SelectedItems, Value & "; "), /* <-- Modify formula here */
DateTime: Text(Now())
}
);
Navigate(CheckoutConfirm2,ScreenTransition.None)

More details about the Concat function, please check the following article:

Concat function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Kris,

 

Thanks for the reply! 

 

Yes I want to convert the selected Values within the combobox into a text value so that I can add a new record in the TransactionsOut table. The values for Combobox are from the AssetList table (Eg. C1 (Camera 1), B2 (battery 2) etc.

 

The error I receive says that the AssetTag column in the TransactionsOut table only accepts text and the values I am supplying from the combobox is a record or a table value and not text.

The solution you provided seems to have worked! Thanks again!

Hi @tfmarcomtf,

Have you solved your problem?

If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,850)