Is it possible hide/show choice items related another field? - sharepoint

is it possible to hide/show column items based on another field in SharePoint 365?
Example:
In first column I have:
Item 1
Item 2
Item 3
In second column I have:
Item A
Item B
Item C
Item D
I need when I select the item in first column, in the second only appaers some of them:
First Column
Second Colum
Item 1
Item A
Item 1
Item B
Item 2
Item C
Item 3
Item D
PS: I don't have "admin center" access and I can't use Power Apps in this case.

You can refer to this article to create two lists (First list and Second list) to store the item values of the two columns, and then reference them in the main list through the lookup column. Add a Content Editor Web Part to implement changes using HTML (require editing the page in classic mode).
Script details: column choice based on the value of another column choice

If you are using SharePoint online modern experience, you cannot do this using SharePoint default capabilities.
You have below options:
Easiest way: Use Power Apps to customize list forms and cascading dropdowns. I know you mentioned you can't use Power Apps - but this is easiest way (check other options below)
a. Working with Cascading Lists in SharePoint and Power Apps
b. Create dependent drop-down lists in a canvas app
Completely customize list form using SPFx form customizer: Build your first Form customizer extension - lot of development work needed
Use JSON formatting - You can use list JSON view formatting to add new items from within list view if you have less number of fields to submit while creating new items.
Example: Dependent-DropDown

Related

How do I use a power apps form for a lookup column?

I have a SharePoint List (say "List-A") with plenty of columns, some of which are lookup columns.
These are just used to construct a choice columns, where the items in the choice drop down are the items of a column in a different List ("List-B").
I have used the function on SharePoint to integrate List-A with Power Apps Form. This creates a Power Apps form that is readily available.
For the Lookup choice columns, I have added List-B as the data source, and am using the items from the correct column as items in the choice that is linked to the lookup column. This correctly populates the drop down menu as expected.
Now when I publish this form and fill it from sharepoint (it pops up as it should hafter clicking New in the List view) I can fill the entire form and submit with no issue. However all the lookup columns remain blank, as if the form returned a null value instead of the selected.
I have both datasources set up:
The update property of the datacard connecting to the SharePoint List is equal to the Selected of the datacard containing the combobox (combobox is called DataCardValue43).
The items property of the combobox is equal to the correct column of List-B.
As an alternative solution, I have attempted to make a different column that is just one line of text. For this column, I have made a combobox once again setting the items property to the column in List-B. The intention was to return the selected value as a string. It was attempted thus:
where combobox1 once again manages to give the correct options in the drop down box but returns only Null.
To study it further, I have made a power apps flow that takes Create New Sharepoint List object as input. Here I see that the values are indeed Null
The one called "Return" is the text column that I made, and the other being the lookup column. I do notice that the Lookup column isn't called Value, but id. I don't know what to do with that information though.
I really just want to have a column in my power apps form that lets you choose and the choices are values from a column in a different List. What do I do, and why doesn't what I've already done work?
Thank you.
Please follow the steps below to solve the issue.
1: Add a Lookup column in SharePoint List.
2: Open that list in Power Apps by using the Customise Forms Option From SharePoint.
3: The Item property of Lookup field will be by default as follow:
Choices([#'CustomisingSharePointList'].LookupColumnListName)
4: There is no need to change/delete the lookup field with any custom dropdown or combo box. This is the point, where you are doing mistake by adding a custom combobox and replacing the original Lookup dropdown. If you want to change datasource, apply filter or sort the data, you can do all these thing to the same original lookup column.
e.g I have applied filter and sort functions to the existing data:
Sort(Filter(Choices([#'CustomisingSharePointList'].'LookupColumnListName'), Value in Filter(LookupColumnListDataSoure,Progress.Value = "Open").ID),Id)
5: When you will publish the list, it will work fine.
Note:
CustomisingSharePointList: List in which we have added a lookup column.
LookupColumnListName: List to which the lookup column actually belongs to.
LookupColumnListDataSoure: You need to add the original list as data source in power apps to use the above filter. This step is optional and applicable only if you apply filter like I did in step 4

Autofill sharepoint list form based on currently filtered field

I have 2 lists that are connected. When I filter List A by ProjectID, I get results in List B only for that projectID.
What I am trying to do is, let's say the List A filter is on Project ID: 1.
When I go to add a new item to List B, the field 'Project ID' will automatically be filled with ID 1.
Any ideas on ways to go about doing this?
Is ProjectId a lookUp column in ListB?
If not and you are using the default edit form of SharePoint then it is not straight forward. I think the easiest approach would be InfoPath form if you are allowed to publish them in your SharePoint environment.

SharePoint 2013 - Filtered View for a list based on value in a related list via a lookup column value

I have two SharePoint lists (only minimal columns described below for brevity).
The first has two columns, a text column called Name, and a person/group column called head of service.
The second has two columns, a lookup column called Service (which looks up from List1), and a text column called Value.
I would like to be able to create a view for the second list so it shows only the rows created by the current user AND any rows that the current user is Head of Service for - i.e. by looking at the relationship between the two tables and comparing the current user to the HeadOfService column in the first table.
I'm running in the Office365 SharePoint 2013 environment.
Since there's no way for SharePoint to read who is viewing a list and show different views based on that alone, the best you're going to get are pre-made views per user based on Created By and Head of Service.

Sharepoint passing parameter from one list to another

I have 2 Sharepoint lists. I want to send ID number from one list to another which can be used as a filter value in second list. So when I click on text of issue list, it should go to another list which shows all the issues related to corresponding ID number.
I am using Sharepoint 2013 and Sharepoint 2013 Designer.
You need to create ID number as a lookup column.
See:
Create list relationships by using unique and lookup columns
http://office.microsoft.com/en-us/sharepoint-help/create-list-relationships-by-using-unique-and-lookup-columns-HA102771358.aspx

Sharepoint LookUp field on Choice field?

How to create a lookup field for the Choice field..For eg: In a list i have Choice field and i have to create an lookup column in other list pointing to this choice field ..When i select this list this column is not appearing in the dropdown...Please let me know if there is any Limitation for that
It is not possible to create a lookup field for a choice (dropdown) field. There are two ways to resolve your problem: The programmatic approach and the workaround.
The programmatic approach involves an creating event receiver to do the magic - pretty work intensive. But there is an explanation here:
Sharepoint 2010 - How to use List Events to Set a Column's Value using Visual Studio 2010 (C#)
You can also just create another list, containing your choice field values and use a calculated field as a source for your lookup column. Check out the following explanation:
Using a lookup field on a choice field workaround
the programmatical Solution is at risk to run into an endless recursion:
The ItemAdded Event and UpdatedEvents are asynchrone. This means, that the command: this.EventFireingEnabled = false is not threadsafe. After systemUpdate you set EventFireingEnabled to true.
But because the ItemUpdated is asynchronus, you cannot guarantee, that the ItemUpdated for your system.update has already been called at this time!.
You can use calculated column is source list, that will display value of Choice column. Then you can add lookup column for this calculated field. It will work only for Choice column with single selection. For multiple selection you can use 3rd party components like that:
http://www.sparqube.com/SharePoint-Lookup-Column
It works out of the box for me... but the lookup option is is only available if you go to "List Settings" and click on "Create Column"
here is how I configured my column on sharepoint online (in 2019) and it works perfectly... this is copy and pasted from the list settings screen under this column...
Column name: Equipment List
The type of information in this column is: Lookup
Get information from: Equipment Master List
In this column: "Equipment Name" (dropdown selector of all the column names on the other list)
Allow multiple values (to be selected) [TICKED]
there are some notes lower down too..
Relationship
A lookup column establishes a relationship between list items in this list and related items in the target list. Specify the relationship behavior enforced by this lookup column when a list item in the target list is deleted.
When an item in the target list is deleted, cascade delete will delete all related items in this list. Restrict delete will prevent the deletion of an item in the target list if it has one or more related items in this list.
Enforce relationship behavior [CHECKBOX]
radio buttions:
Restrict delete
Cascade delete

Resources