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 / "DefaultSelectedItems"...
Power Apps
Unanswered

"DefaultSelectedItems" Property, returning a "INJECT0" value

(0) ShareShare
ReportReport
Posted on by 34

The expression I've used in the "DefaultSelectedItems" Property is returning a "INJECT0" value, instead of the Content Type Value that is should. How can i fix this? I've tried it on all three content types and i get the same "INJECT0" value.

 

I have a SP List with three Content Types( Software, Hardware, Trainers) On the SP Integrated Canvas App I created three forms, one for each Content Type. The Form is only visible when the user selects a specific value (Values created in Item Property). This value is only used to create a var. The var is then used on the three forms visible property to determine which form will be visible. 

 

The Content Type Value and ID are copy and pasted directly from the content type setting within the SP list. 

 

{
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
 Id: "0x0100E675901833CCA449B074F3299BBAC0EF001DD6B53385D083499B45C1880D9230B0",
 Value: "TTI_Hardware-Enablers"
}

 

 

 

1-HARDWARE.png

3-HARDWARE.png

2-HARDWARE.png

Categories:
I have the same question (0)
  • v-mengmli-msft Profile Picture
    on at

    Hi @jsnwilmot ,

     

    I can't reproduce your issue. Maybe you can try another way.

    Filter(Choices([@List].'{ContentType}'),Name="TTI_Hardware-Enablers")

     

    Best regards,

    Rimmon

  • jsnwilmot Profile Picture
    34 on at

    That didn't work in the "DefaultSelectedItems" Property. It did not like "Name"

  • jsnwilmot Profile Picture
    34 on at

    After additional testing, it appears that the code functions correctly with the "DefaultSelectedItems" property in the classic form, but not in the Modern Form. It's reassuring to know that the code is operational, but the question remains: why is it incompatible with the Modern Form, and what steps can be taken to resolve this issue?

    {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
     Id: "0x0100E675901833CCA449B074F3299BBAC0EF001DD6B53385D083499B45C1880D9230B0",
     Value: "TTI_Hardware-Enablers"
    }

     

    jsnwilmot_0-1713879073619.png

     

  • Verified answer
    v-mengmli-msft Profile Picture
    on at

    Hi @jsnwilmot ,

     

    I tried to reproduce your issue and found that it might be due to the fact that you didn't set the Field.

    When I didn't add any fields, it showed a number. 

    vmengmlimsft_1-1713924181265.png

    When I added Name field, it showed content type's name.

    vmengmlimsft_2-1713924243355.png

     

    I think it's because the classic combo box automatically set the Field, but modern combo box sometimes needs to be set manually.

     

    There are some differences in recognition data between classic and modern controls, and I'm not sure if this is due to compatibility with modern controls. Therefore, I recommend that you use Filter in DefaultSelectedItems to return the data formats supported by modern controls, below formula not recognized by modern combo box from my testing.

    {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
     Id: "0x0100E675901833CCA449B074F3299BBAC0EF001DD6B53385D083499B45C1880D9230B0",
     Value: "TTI_Hardware-Enablers"
    }

     

    Anyway, if you need to use modern combo box, I suggest you try my method. If the method still doesn't work, you can consider the classic combo box. Modern controls are still being updated, and in most cases where they report errors, we recommend that users switch to classic controls if the problem cannot be resolved.

     

    ______________________________________________________________________________________________________________

    If my answer helps you solve the problem, please accept it as a solution.😀

     

    Best regards,

    Rimmon

     

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard