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

PowerApps - Drop Down List

 

I have created a powerapp form using a table from an Oracle database and I am trying to create the following and I am experiencing some diffuculties: 

 

  1. Create a drop down listing for a field on a powerapps form using a table (APPOWER_WELL_LIST) created in an oracle database. (see label 'C' of attached document) 
    • The Functionality is - the user selects a well name from the drop down list (see label 'A' of attached document) and the system populates the well name as well as the well stage fields on the power app form.  See Label "B' of the attached document. 
  2. Automatically populate the primary key PA_WELL_HDR_S on the powerapps form by calling an insert trigger/seqence which is in the oracle database from within the powerapps form. How do I call a trigger in powerapps to insert the primary key id of the table based on the trigger/sequence.  See Label "D' of the attached document. 

 

 

6 REPLIES 6
shailendra74
Level 8

Re: PowerApps - Drop Down List

For #1 -   set the default property of the text control to  dropdown.Selected.ID gives ID 

 

#2 - return the primary key value from stored procedure to powerapps

 

You need to configure MS Flow to call stored procedure, once data is successfully inserted, return the primary key to MS flow which in turn will pass back to powerapps.

 

Thanks.

saspencer
Level: Powered On

Re: PowerApps - Drop Down List

Hi, I am new to Powerapps.  I am not clear can you provide some more details to your reply.  Thank you. 

shailendra74
Level 8

Re: PowerApps - Drop Down List

ok.

 

  1. If WELL_STAGE displays value based on the selection of WELL_NAME, you have a label instead of TextInput 
  2. Considering the control name of WELL_NAME is ddWELLNAME, set the Text/Default property of WELL_STAGE to ddWELLNAME.selected.ID
  3. You cannot call a trigger from powerapps, instead create a stored procedure and call the procedure from MS Flow
  4. onChange of ddWELLNAME, configure the flow created in #3

 

Alternative to #3-#4: Create a view to get the sequence number from dual table and onChange of ddWELLNAME, write below code 

 

ClearCollect(collectionSEQNo, VW_PA_WELL_HDR_tr)
UpdateContext({SEQNO: First(collectionSEQNo).PA_WELL_HDR_s})

set the default value property of PA_WELL_HDR_S to SEQNO

 

Thanks.

saspencer
Level: Powered On

Re: PowerApps - Drop Down List

Thank you for your additional information. I have create the view as you indicated.  Can you indicate where should I put the code?

saspencer
Level: Powered On

Re: PowerApps - Drop Down List

I have included the errors when I apply the code. I am not sure if I have placed them in the incorrect place in the app.

saspencer
Level: Powered On

Re: PowerApps - Drop Down List

Hi Good Day,

 

I am very grateful for your assistance. The automatic population of the sequence when the well name is changed is working now.

 

I am now getting the following error on the Well_name drop down. - The Update is not working when I select the well name. The selected well name is not saving in the table upon insertion. I am seeing the other field items but the well name column is blank.

 

I did the following:

On the well name drow down:

  • Create a View, Create a Collection: 
  • OnVisible:Collect(Collection1, '[APPOWER].[VW_PA_WELL_HDR_TR]')
  • Onselect: ClearCollect(Collection1, '[APPOWER].[VW_PA_WELL_HDR_TR]')
  • OnChange: UpdateContext({SEQNO:First(Collection1).SEQNO })
  • Created a timer on well name drop down to refresh the datasource since the PA_WELL_HDR_S was not changing unless I manually refresh

1. OnTimerEnd - Refresh('[APPOWER].[VW_PA_WELL_HDR_TR]')

2. Duration:10000, Set Repeat : On, Auto Start : On, Visible: Off

 

On the PA_WELL_HDR_S test input:

• OnChange: SEQNO

• Set default: SEQNO

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 51 members 4,907 guests
Please welcome our newest community members: