쉼표로 구분된 텍스트 필드에서 수식 필드를 만듭니다.

8377 단어 Salesforce
Answers에서 답변할 때 사용하는 정보 요약으로 돌아가기
이런 것은 Apex 트리거로 split 함수를 사용하면 바로 할 수 있다.
라고 대답했지만, Apex는 싫다고. 많네요 Salesforce 세계에서는... Apex를 싫어하는 사람들.
나로부터 하면 간단하게 할 수 있는데, 일부러 복잡한 식으로 하고 싶은 사람들이 이상하다.
(또한 수식 항목이 싫어하는 이유로 검색할 수 없는 경우도 있습니다)
뭐, 한번 진지하게 식으로 써 보았습니다.
이런 텍스트 필드가 있다는 것
Street Name, City, State, ZIP
이를 별도의 수식 필드에 표시합니다.
결과는 생겼어. 귀찮지만...

St 이름
LEFT(address__c,FIND(',',  address__c )-1)
LEFT(MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )),FIND(',',MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )))-1)
State
LEFT(MID( MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) , FIND(',', MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) ) + 1, LEN( MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) )),FIND(',', MID( MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) , FIND(',', MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) ) + 1, LEN( MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) )) )-1)
Zip
MID( MID( MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) , FIND(',', MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) ) + 1, LEN( MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) )) , FIND(',', MID( MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) , FIND(',', MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) ) + 1, LEN( MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) )) ) + 1, LEN( MID( MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) , FIND(',', MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) ) + 1, LEN( MID( address__c , FIND(',', address__c ) + 1, LEN( address__c )) )) ))
Formula field to get specific text from a longer text

또한 또 다른 추가 악마


수식의 크기로부터 생각하면 이것이 한계일지도 모르겠네요. 4600 초과.

거리 이름 1
LEFT(full_address__c,FIND(',',full_address__c)-1)
거리 이름 2
LEFT(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)),FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))-1)
LEFT(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))),FIND(',',MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))))-1)
State
LEFT(MID(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))), FIND(',',MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))))) + 1, LEN(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))))),FIND(',',MID(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))), FIND(',',MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))))) + 1, LEN(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))))))-1)
ZIP
MID(MID(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))), FIND(',',MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))))) + 1, LEN(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))))), FIND(',',MID(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))), FIND(',',MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))))) + 1, LEN(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))))))) + 1, LEN(MID(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)))), FIND(',',MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))))) + 1, LEN(MID(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c)), FIND(',',MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))) + 1, LEN(MID(full_address__c, FIND(',',full_address__c) + 1, LEN(full_address__c))))))))
Get separate texts from 1 comma separated text

좋은 웹페이지 즐겨찾기