Sharepoint online list上的"Caculated type"Column如何設定IF公式去比對兩個"Person Type"的Column是否相同??

匿名
2024-06-14T03:41:56+00:00

我在Caculated Type Column使用了以下的幾種公式,皆無法成功地讓此項目去進行正確的判斷。

=IF("[Auditor]"="[Finding Owner]","Bravo","Punish")

=IF("[$Auditor.title]"="[$Finding Owner.title]","Bravo","Punish")
=IF([Auditor]=[Finding Owner],"Bravo","Punish")

=IF([$Auditor.title]=[$Finding Owner.title],"Bravo","Punish")

=IF("[Auditor.title]"="[Finding Owner.title]","Bravo","Punish")

=IF([Auditor.title]=[Finding Owner.title],"Bravo","Punish")

即使在Insert Column的部分,也無法Add我所需要的項目進去Formula。

Microsoft 365 與 Office | SharePoint | 商用版 | Windows

鎖定的問題。 此問題已從 Microsoft 支援服務社群移轉。 您可以對其是否有幫助進行投票,但無法對問題新增註解或回覆,或進行追蹤。

0 則留言 沒有留言

5 個回答

排序依據: 最實用
  1. 匿名
    2024-06-20T07:09:57+00:00

    Hi Shawn,

    基於你提出的設定Power Automate流程的問題,我自己做了一個demo,讓你參考。以下是詳細步驟:

    1. 新增步驟:When an item is created 或 modified。選擇對應的Site Address和List Name。
    2. 新增步驟:Get Items。選擇對應的Site Address和List Name。
    3. 新增步驟:Initialize variable。輸入Name和Type。 Name處的變數可以設定為任意的,僅為在下一步「Set variable」中選擇Name。 Type選為String。

    1. 新增步驟:Set variable。 Name選擇Initialize variable步驟中的名字。在Value處新增動態內容,選擇為People的兩個欄位。

    1. 新增步驟:Condition。在左邊欄中同樣是新增動態內容,選擇Person1欄的Person1 Email;在右邊欄位中選擇Person2欄位的Person2 Email。條件是is equal to。

    1. 為該判斷條件加入具體更新的內容。

    If yes,新增步驟Update Item。選擇對應的Site Address和List Name。 Id選擇新增動態內容為List item ID,即ID。

    因為我事先在SharePoint List中添加了一個single line of text欄位名為”Same Person?”,因此我只需在這裡填上如果兩个欄位的人是同一人時,想要展示的值。我在這裡填寫的是Yes。根據你的需求,你可以填入"Bravo"。

    If no,同樣加入步驟Update Item。填入對應的設定。

    至此,該Power Automate就創建完成了。在建造Power Automate後,記得儲存並測試它是否能正常運作。

    此Power Automate在我的list上是可以正常運作的。

    因为使用Power Automate的步驟較為複雜,若您在使用Power Automate時有任何疑問,可以在Microsoft Power Automate Community發文諮詢。

    Best regards,
    Sophia

    此回答有幫助嗎?

    有 1 人認為此回答有所幫助。
    0 則留言 沒有留言
  2. 匿名
    2024-06-14T06:42:55+00:00

    Hi Shawn,

    在SharePoint Online中,計算列公式的語法和功能有限,不支援直接比較複雜對象,因此我們無法透過使用IF公式來實現此需求。

    我在SharePoint Online進行了一个測試,如果強行使用計算列公式來進行計算,會得到錯誤的結果,如下圖。

    對於Person1ID欄,我使用如下JSON來格式化欄位。

    {

    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",

    "elmType": "div",

    "txtContent": "[$Person1.id]"

    }

    Person2ID欄位類似。

    對於IsSamePerson,我使用了

    =IF([Person1ID]=[Person2ID], "Yes", "No")來計算。

    基于此,你可以在SharePoint · Community提出你的回饋和建議,SharePoint產品團隊會考慮在後續的更新中修改、增加此功能。

    由於計算列不支援直接提取「Person」類型欄位的屬性(如Email或DisplayName),我們需要先將Person列轉換為可比較的文字值或建立額外的列將其轉換為可比較的值。可以使用Power Automate來完成這項任務。

    我看到一個和您的需求比較類似的帖子:Extract email from people picker in another column。

    一個比較可行的想法是使用Power Automate來根據Person列的Email擷取出來,再進行比較來判斷這兩個columns是否相同。以下是具體的操作步驟。假設你有兩個Person列,分別名為Person1和Person2。

    1. 在SharePoint清單中新增的single line of text列,例如「Person1Email」和「Person2Email」。
    2. Power Automate串流設定:

    1) 建立或修改一個流,在流中新增觸發器「當項建立或修改時觸發」。

    2) 新增Get item動作。

    3) 增加兩個「設定變數」動作,將Person1和Person2列的email address賦值給變數。

    4) 增加「條件」動作,比較這兩個變數。

    5) 根據條件結果更新清單項,將結果寫入新的新的single line of text欄位。

    使用Power Automate的步驟較為複雜,但它提供了更多的靈活性和功能。若您在使用Power Automate時有任何疑問,可以在Microsoft Power Automate Community發文諮詢。

    Best regards,

    Sophia

    此回答有幫助嗎?

    有 1 人認為此回答有所幫助。
    0 則留言 沒有留言
  3. 匿名
    2024-06-22T02:20:28+00:00

    Good day Sophia ,

    Thank you for your tutorial which is such detailed .

    I follow the process which you teach me , and the result is looked like different with yours .

    I think I must make some mistakes in my setting ...

    Could you assist me to review my setting ? I want to know what's happened on my power automate...
    Thank you again for your professional knowledge and patient tutorial .





    It look like that I cannot choose the "Person Type Colum" in my condition set ...

    此回答有幫助嗎?

    0 則留言 沒有留言
  4. 匿名
    2024-06-19T07:02:08+00:00

    Hello Sophia ,

    I just try some operation in my power automate , then I cannot set Variable in my process like as picture .

    此回答有幫助嗎?

    0 則留言 沒有留言
  5. 匿名
    2024-06-19T05:10:12+00:00

    Hello Sophia , 非常感謝您的協助與回覆。

    請問關於Power Automate流程設定,是否有詳細的過程教學。

    Power Automate串流設定:

    1) 建立或修改一個流,在流中新增觸發器「當項建立或修改時觸發」。

    2) 新增Get item動作。

    3) 增加兩個「設定變數」動作,將Person1和Person2列的email address賦值給變數。

    4) 增加「條件」動作,比較這兩個變數。

    5) 根據條件結果更新清單項,將結果寫入新的新的single line of text欄位。

    此回答有幫助嗎?

    0 則留言 沒有留言