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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Lookup input with data...
Power Apps
Unanswered

Lookup input with dataset control.

(0) ShareShare
ReportReport
Posted on by 482

I'm making a dataset control that will sit on a form. I'm also trying to pull in additional data if it exists from a lookup control, but when I add it and hook it up to a value on the form the dataset stops loading.

 

<property name="lookupField" display-name-key="lookupField" description-key="lookupField" of-type="Lookup.Simple" usage="input" />

 

That's all I've done and when I configure it with a value the control dataset stops loading. Is this not allowed?

I have the same question (0)
  • cchannon Profile Picture
    4,702 Moderator on at

    I haven't tried using a lookup as an input and not as bound, but I wouldn't be surprised if that is the issue: that a lookup can only be bound, not input.

  • skoofy5 Profile Picture
    482 on at

    Why not surprised? Is there a technical reason?

     

    Thanks for helping my understanding.

  • cchannon Profile Picture
    4,702 Moderator on at

    Because it would be pretty much impossible for you to provide a static value for a lookup. It would only be practical to provide a field reference.

     

    Just a guess.

     

    @DianaBirkelbach do you know? Is it possible to have lookup.simple as usage input and not bound?

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @skoofy5 , Hi @cchannon , 

     

    In my opinion it should work, and if it doesn't, it might be a bug.

    Could you share the manifest with us?

     

    BUT, I would ask if the lookup of type input would help much? Having it only of type "input" on a model-driven app form means, that you get the value only the first time the PCF is loaded, but you don't get the value in case the lookup changes on the form. The user would need to refresh the form. Would that be enough for your use-case?

     

    What actually means "the control dataset stops working"? Do you see an error in the console? Are you still able to attach the PCF to a (another) dataset (is it still in the list of available PCFs for the dataset)?

     

    Let's see if we find a solution together...

  • skoofy5 Profile Picture
    482 on at

    I can force the form to reload if I need the updated value - which should be pretty rare so input is fine. It doesn't throw an error, the dataset parameter just returns an object with empty values when I add the property as above to my manifest AND configure it (i.e. assign a field to it on the form). This seems to happen with a default manifest.

    skoofy5_0-1637158219060.png

     

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @skoofy5 , 

     

    Sounds like a bug. Would be good to confirm that the issue doesn't happend when it's a string property (but I think you would need to remove the PCF before you change the property type).

    What do you mean by "default manifest"?

     

    @HemantG : Is this a know issue?

     

  • skoofy5 Profile Picture
    482 on at

    Default as in what's generated.

    <?xml version="1.0" encoding="utf-8" ?>
    <manifest>
     <control namespace="datasetControl" constructor="datasetControl" version="0.0.1" display-name-key="datasetControl" description-key="datasetControl description" control-type="standard" >
     <!--external-service-usage node declares whether this 3rd party PCF control is using external service or not, if yes, this control will be considered as premium and please also add the external domain it is using.
     If it is not using any external service, please set the enabled="false" and DO NOT add any domain below. The "enabled" will be false by default.
     Example1:
     <external-service-usage enabled="true">
     <domain>www.Microsoft.com</domain>
     </external-service-usage>
     Example2:
     <external-service-usage enabled="false">
     </external-service-usage>
     -->
     <external-service-usage enabled="false">
     <!--UNCOMMENT TO ADD EXTERNAL DOMAINS
     <domain></domain>
     <domain></domain>
     -->
     </external-service-usage>
     <!-- dataset node represents a set of entity records on CDS; allow more than one datasets -->
     <data-set name="sampleDataSet" display-name-key="Dataset_Display_Key">
     <!-- 'property-set' node represents a unique, configurable property that each record in the dataset must provide. -->
     <!-- UNCOMMENT TO ADD PROPERTY-SET NODE
     <property-set name="samplePropertySet" display-name-key="Property_Display_Key" description-key="Property_Desc_Key" of-type="SingleLine.Text" usage="bound" required="true" />
     -->
     </data-set>
     <property name="lookupField" display-name-key="lookupField" description-key="lookupField" of-type="Lookup.Simple" usage="input" />
     <resources>
     <code path="index.ts" order="1"/>
     <!-- UNCOMMENT TO ADD MORE RESOURCES
     <css path="css/minHeightDatasetTEST.css" order="1" />
     <resx path="strings/minHeightDatasetTEST.1033.resx" version="1.0.0" />
     -->
     </resources>
     <!-- UNCOMMENT TO ENABLE THE SPECIFIED API
     <feature-usage>
     <uses-feature name="Device.captureAudio" required="true" />
     <uses-feature name="Device.captureImage" required="true" />
     <uses-feature name="Device.captureVideo" required="true" />
     <uses-feature name="Device.getBarcodeValue" required="true" />
     <uses-feature name="Device.getCurrentPosition" required="true" />
     <uses-feature name="Device.pickFile" required="true" />
     <uses-feature name="Utility" required="true" />
     <uses-feature name="WebAPI" required="true" />
     </feature-usage>
     -->
     </control>
    </manifest>
  • Polmon Profile Picture
    21 on at

    Is there any update on this issue? I've encountered the same problem with my dataset control with a lookup field as an input.

  • skoofy5 Profile Picture
    482 on at

    I've not heard anything about a fix.

    I ended up writing my own query by grabbing the current form id/etn and added a text param property where I would set the schema name of the lookup.

    const entityId = (context.mode as any).contextInfo.entityId;
    const entityTypeName = (context.mode as any).contextInfo.entityTypeName;
    const lookupField = context.parameters.lookupSchemaName.raw;
  • Polmon Profile Picture
    21 on at

    Thanks @skoofy5, that's the same thing I ended up doing. Its not ideal as it only picks up the saved value, not whatever is currently selected in the control, but it's enough to get it working for now. Hopefully we will get a fix for this sometime soon.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard