web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using the value select...
Power Apps
Answered

Using the value selected in a dropdown to a Sharepoint List and creating a new unique string

(0) ShareShare
ReportReport
Posted on by 15

Hi, I am trying to create an inventory app, I am new to powerapps and want to learn how to use it effectively. Currently, I have a dropdown with a list I made in the Items section: ["Select One","16G","20G","22G","24G","26G"]. I am trying to use the string selected to a sharepoint list using patch on a submit button. Here is the code for that button.

Patch( 'PowerApps Inventory',Defaults('PowerApps Inventory'),
{
Title: dropGauge.Text 
'Heat Number':Value(txtHeatNumber.Text),
'Mill ID': txtMillID.Text,
Weight: Value(txtWeight.Text),
'SKU #': changelabSKU.Text
}
)
Title is where I am trying to export it into a sharepoint list.
Secondly, I am trying to use the string to create a custom string to create a SKU# for that item. But it doesnt seem to work as I thought. Here is the code on the text input 
"CL" & setGauge.Text & Left(txtHeatNumber.Text,2) & Left(txtMillID.Text,2)
setGauge is a value I tried having be made with the Set() formula anytime the dropdown is selected or changed.
 
I am would love an explanation as to what I am doing wrong opposed why just getting the write answer.
 
Thank you for your time,
CR
Screen Shot 2024-01-29 at 11.08.42 AM.png
Categories:
  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @Keeptheheat21 

     

    try this please:

     

    Patch(
     'PowerApps Inventory',
     Defaults('PowerApps Inventory'),
     {
     Title: dropGauge.Text,
     'Heat Number': Value(txtHeatNumber.Text),
     'Mill ID': txtMillID.Text,
     Weight: Value(txtWeight.Text),
     'SKU #': changelabSKU.Text
     }
    )

     

     

    "CL" & setGauge.Text & Left(txtHeatNumber.Text,2) & Left(txtMillID.Text,2)

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • Keeptheheat21 Profile Picture
    15 on at

    No, it did not work unfortunately. The error I got was " The Patch function has invalid argument. The type of this arguement 'Title' does not match the expected typer "Text". Found Type "Error".

  • vaubeee Profile Picture
    533 on at

    Hi @Keeptheheat21 ! To me it looks like your variable setGauge does not have a text property. Could you provide the code for your Set(setGauge,..). Maybe you can also set up the hole thing when creatin the variable. Randbetween is a nice funktion to generate random combination, like so:

     

     

     

    Set(setGauge;Concatenate("B"; Text(RandBetween(1;999)); "-"; "010"; "-"; Text(RandBetween(4;44))))

     

     

    would generate Bxxx-010-xx

    Of course you can also use your Left(txtHeatNumber.Text,2) & Left(txtMillID.Text,2) in there

     

    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question / helped to solve your problem, please accept as solution and give me a Thumbs up. Thanks! - Remember: you can accept more than one post as a solution.  

     

  • Keeptheheat21 Profile Picture
    15 on at
    Set(setGauge,dropGauge)  this is what I have in the OnChange and OnSelect. I am trying to use the what is selected in the dropdown as part of the SKU# because it better helps understand the item were dealing with when looking at a SKU.
     
  • Verified answer
    Keeptheheat21 Profile Picture
    15 on at

    Figured it out,  here is the solution.

     

    Patch(
    'PowerApps Inventory',
    Defaults('PowerApps  Inventory'),{
    Title: dropGauge.Selected.Value,
    'Heat Number': Value(txtHeatNumber.Text),
    'Mill ID': txtMillID.Text,
    Weight: Value(txtWeight.Text),
    'SKU #': changelabSKU.Text
     
    }
    )
    and for the SKU
    "CL" & dropGauge.Selected.Value & Left(txtHeatNumber.Text,1) & RandBetween(0,999) &Left(txtMillID.Text,1) & RandBetween(0,999)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard