function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anirban SenAnirban Sen 

{!pickVal == objRecord.{v.kanbanPicklistField}} can anyone give an workaround?

{!pickVal == objRecord.{v.kanbanPicklistField}} is there any workaround to use this type of expression is possible to use in lightning?
Dheeraj SharmaDheeraj Sharma
 Hi Anirban, 
your question is not clear to me. But still, I try my best to answer your question.

So I consider this profileVal is an attribute on your component and you want this attribute to compare with your another sObject attribute values.
I have prepared a recipe for better understanding.
Please select as best answer if it satisfy your requirement.
 
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
		
    <aura:attribute name="record" type="Object"/>
    <aura:attribute name="recordError" type="String"/>
    <aura:attribute name="recordFields" type="Object"/>
    
    
    <force:recordData aura:id="recordData"
                      targetError="{!v.recordError}"
                      targetFields="{!v.recordFields}"
                      targetRecord="{!v.record}"
                      recordId="{!v.recordId}"
                      layoutType="FULL"
                      mode="EDIT"/>
    
    
    <aura:attribute name="temp" type="String" default="Test"/>
    
    <aura:if isTrue="{!v.temp == v.recordFields.Name}">
    
    	DO something here if true
        <aura:set attribute="else">
			Do Something if false
        </aura:set>
    </aura:if>
    
    
</aura:component>




 
Anirban SenAnirban Sen
Hi Dheeraj,
The problem is suppose there is another attribute -
<aura:attribute name="fieldName" type="String" default="Name"/>

In the if condition ( <aura:if isTrue="{!v.temp == v.recordFields.Name}"> ) inspite of using "v.recordFields.Name" I want to use "v.recordFields.(v.fieldName)". In one word I wnat the fieldname to be dynamic, coming from a attribute
Dheeraj SharmaDheeraj Sharma
lightning does not support dynamic field referencing the way you want. I assume you are working with fieldset. So for that you need to manage ur fields in js controller.