문제

I got a list where i use the PromotedState column to display if a site is a sitepage or a newspage based on the number "0" and "2" (0=sitepage, 2=newspage).

The column is populated with these values (0 or 2) now u want to create a new column called Type page that look up the PromotedState value and display the text Sitepage or Newspage based on the populated value.

도움이 되었습니까?

해결책

You can do this with Column Formatting directly on the PromotedState column using this format:

{
  "elmType": "span",
  "txtContent": "=if(@currentField == 0, 'Sitepage', if(@currentField == 2, 'Newspage', ''))"
}

The double check is there to account for folders.

You can apply this format by adding the Promoted State column to your view and choosing Format this Column in the column menu. Then just paste the above and hit Apply.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top